<UserControl
  xmlns="https://github.com/avaloniaui"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vm="using:ControlsSandbox.ViewModels"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  x:Class="ControlsSandbox.Views.TableView"
  Background="#F0F0F0">

  <Design.DataContext>
    <vm:TableViewModel />
  </Design.DataContext>
  
  <ItemsControl
    Items="{Binding Cells}"
    Width="{Binding Width, Converter={StaticResource mm}}"
    Height="{Binding Height, Converter={StaticResource mm}}">
    <ItemsControl.ItemsPanel>
      <ItemsPanelTemplate>
        <Canvas />
      </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.Styles>
      <Style Selector="ItemsControl ContentPresenter">
        <Setter Property="Canvas.Left" Value="{Binding X, Converter={StaticResource mm}}" />
        <Setter Property="Canvas.Top" Value="{Binding Y, Converter={StaticResource mm}}" />
      </Style>
    </ItemsControl.Styles>
  </ItemsControl>

</UserControl>